* xterm.c (x_new_font): If font_names is zero, that's all the
authorJim Blandy <jimb@redhat.com>
Fri, 11 Jun 1993 07:02:36 +0000 (07:02 +0000)
committerJim Blandy <jimb@redhat.com>
Fri, 11 Jun 1993 07:02:36 +0000 (07:02 +0000)
indication we get that no matches were found.

src/xterm.c

index 9900ab0888406411c8c7d3a68d3a8fef82f10ed4..4d3187d3d0e22014f3d19c78edd94f6f2c3096b8 100644 (file)
@@ -3935,6 +3935,11 @@ x_new_font (f, fontname)
   font_names = (char **) XListFontsWithInfo (x_current_display, fontname,
                                             1024, &n_matching_fonts,
                                             &font_info);
+  /* Apparently it doesn't set n_matching_fonts to zero when it can't
+     find any matches; font_names == 0 is the only clue.  */
+  if (! font_names)
+    n_matching_fonts = 0;
+
   /* Don't just give up if n_matching_fonts is 0.
      Apparently there's a bug on Suns: XListFontsWithInfo can
      fail to find a font, but XLoadQueryFont may still find it.  */